﻿using System;
using System.Linq;
using System.Collections.Generic;

namespace HashFoo.Rest.ServerTests.MockResources
{
    public class JsonSerializerMock : Common.IResourceSerializer
    {
        public T Read<T>(string data)
        {
            return Activator.CreateInstance<T>();
        }

        public object Read(string data, Type type)
        {
            return Activator.CreateInstance(type);
        }

        public string Write<T>(T data)
        {
            return data.ToString();
        }

        public string[] AcceptMimeTypes
        {
            get { return new[] { "application/json" }; }
        }

        public string ContentMimeType
        {
            get { return "application/json"; }
        }
    }
}